1. Field of the Invention
The present invention relates to a data-relaying method and a data-relaying device.
2. Description of the Related Art
Recently, mobile personal computers equipped with communication functions have become capable of connecting to and enjoying service from a visited or foreign network in a so-called mobile-computing environment. Currently, based on the IPv6 (Internet Protocol version 6) standard, protocols such as Mobile IPv6 are being proposed as communication methods for terminal devices (such as personal computers and/or PDAS) serving as nodes.
In Mobile IPv6, the terminal device (hereinafter referred to as “terminal”) has two IP addresses: a home address and a care-of address. The care-of address changes according to the sub-network to which the terminal is connecting, according to movement of the terminal. The home address is fixed and does not change, even if the terminal moves. Japanese Patent Application Laid-open Publication No. 2001-268129 discloses a technique relating to communication between terminals complying with the above-mentioned Mobile IPv6 (such terminals are hereinafter referred to as “Mobile-IPv6-compliant terminals”).
Now, consider a situation of carrying out packet communication between the Mobile-IPv6-compliant terminal and a terminal complying with IPv6 but not with Mobile IPv6 (these terminals are hereinafter referred to as “IPv6-fixed terminals”). As shown in the block diagram of FIG. 1, a movable Mobile-IPv6-compliant terminal 10 and a home agent 20 are connected to a Mobile-IPv6-compliant network (or first network). On the other hand, an IPv6-fixed terminal 30 is connected to a network complying with IPv6 but not complying with Mobile IPv6 (or second network; hereinafter referred to as “IPv6 network”). The Mobile-IPv6-compliant network and the IPv6 network are connected via a router 40. The home agent 20 stores an address-management table in an accompanying storing section. The table establishes relation between the home address and the care-of address. The home agent 20 receives a packet having a new care-of address from the Mobile-IPv6-compliant terminal 10 that has moved, and updates the address-management table.
FIG. 2 shows a format of a message header attached to data in an IPv6 packet. The header shown in FIG. 2 includes, for example: protocol version; traffic class for identifying and distinguishing priority; and flow label for identifying packets which require special operations at the router 40. Further, the header includes: source address which is the address of the terminal sending the packet; destination address which is the address of the terminal receiving the packet; and extension header as an option. Further, as shown in FIG. 3, although the header of a Mobile IPv6 packet has the same format as the message header of an IPv6 packet shown in FIG. 2, the home address is also included in the extension header.
Explanation will be made of a case where the Mobile-IPv6-compliant terminal 10 is turned on and has moved. As shown in the block diagram of FIG. 4, the Mobile-IPv6-compliant terminal 10 having been turned on informs its home address and care-of address to the home agent 20 (S10→S20 in FIG. 4). As shown in FIG. 5, the home agent 20 registers the informed home address 11 and the care-of address 12 with the address-management table (S30). Further, the home agent 20 responds an acknowledge packet to the Mobile-IPv6-compliant terminal 10 (S40). Then, when the Mobile-IPv6-compliant terminal 10 moves (S50), the terminal 10 informs to the home agent 10 the unchanged home address 11 and the new care-of address 12 that has changed after movement (S60). As shown in FIG. 5, the home agent 20 registers the informed home address 11 and the care-of address 12 with the address-management table, and responds an acknowledge packet to the Mobile-IPv6-compliant terminal 10 (S70).
Specific explanation will be made of packet-communication processing between the Mobile-IPv6-compliant terminal 10, which informs the home address 11 and the care-of address 12 to the home agent 20, and the IPv6-fixed terminal 30 via the home agent 20. Firstly, with reference to the flowchart shown in FIG. 6, explanation will be made of sending a packet from the IPv6-fixed terminal 30 to the Mobile-IPv6-compliant terminal 10. As shown in FIG. 6, the Mobile-IPv6-compliant terminal 10 has a value 2001::1 as the care-of address, and a value 2000::1 as the home address.
The IPv6-fixed terminal 30 has a value 3000::1 as its address. Upon sending a packet, the IPv6-fixed terminal 30 sets the source address to be its own address (i.e., 3000::1) and the destination address to be the home address of the Mobile-IPv6-compliant terminal 10 to which the packet is to be sent (i.e., 2000::1) (see 101 in FIG. 6). The home agent 20 receives the packet (102), and searches in the address-management table of FIG. 5 for a record having the same home address as the destination address of the packet (103). If there is a matching record as a result of the search (104, “match in entry” in FIG. 6), the home agent 20 generates (or encapsules) the packet so that the designation has the value indicated in the care-of field, and then sends the packet (105→106). That is, the Mobile-IPv6-compliant terminal 10 receives a packet having a destination with the value in the care-of field (2001::1). Here, the source address of the packet to be sent is kept the same, while the destination address is the care-of address. Thus, even when the Mobile-IPv6-compliant terminal 10 moves, it is possible to update its care-of address in the address-management table of the home agent 20, as explained above.
However, regardless of whether the Mobile-IPv6-compliant terminal 10 has moved or not, if the IPv6-fixed terminal 30 starts communication with the Mobile-IPv6-compliant terminal 10, the IPv6-fixed terminal 30 will send a packet designating the destination to be the home address of the Mobile-IPv6-compliant terminal. Then, communication cannot be established because in a response from the Mobile-IPv6-compliant terminal 10, its care-of address will be the source address.
On the other hand, with reference to FIG. 7, explanation will be made on sending a packet from the Mobile-IPv6-compliant terminal 10 to the IPv6-fixed terminal 30. As shown in FIG. 7, the Mobile-IPv6-compliant terminal 10 has a value 2001::1 as the care-of address, and has a value 2000::1 as the home address. The IPv6-fixed terminal 30 has a value 3000::1 as its address.
Before moving, upon sending a packet, the Mobile-IPv6-compliant terminal 10 sets the source address to have a value having its own care-of address (i.e., 2001::1), and sets the destination address to have a value having the address of the IPv6-fixed terminal 30 to which the packet is sent (i.e., 3000::1) (201 in FIG. 7). Here, the IPv6-extension header of the packet includes a value of the home address of the Mobile-IPv6-compliant terminal 10 (i.e., 2000::1). The IPv6-fixed terminal 30 stores each of the addresses included in the header of the received packet in its storing section. That is, the value of the source address is kept to be 2001::1 in the IPv6-fixed terminal 30. Then, during packet communication, as the terminal moves to another network, the care-of address changes to a value 2002::1 after movement (202). Then, packets including a source address having the care-of address with the changed value will be sent to the IPv6-fixed terminal 30.
Therefore, since the source address differs before and after movement of the terminal 10, packet communication from the same source cannot be identified, and thus, continued packet communication cannot be maintained. That is, if the source Mobile-IPv6-compliant terminal 10 moves, the Mobile-IPv6-compliant terminal 10 will send a packet to the IPv6-fixed terminal 30 using the new care-of address after movement. Therefore, the IPv6-fixed terminal 30 will not be able to receive packets using the new care-of address after movement, which is different from that before movement. Therefore, packet loss will occur.